//
//  KzConMsg.swift
//  Trans
//
//  Created by zcj on 2024/12/31.
//  存放connection的信息

import Foundation
import Network
import NetAction

class KzConMsg:ConnectionProtocol{
    //初始化
    let con:NWConnection
    var timeStamp:TimeInterval = Date().timeIntervalSince1970
    public var lastData:Data = Data()
    var hostName = "default"
    
    //保存文件传输的信息
    var fileDic:Dictionary<FileId,FileTransMessage> = Dictionary()
    //保存文字传输信息
    var wordsArr:Array<StringMessage> = []
    
    @Published var speed:String = "3M" //速度设置
    
    init(con: NWConnection) {
        self.con = con
    }
    
    func update() {
        //更新数据
        //更新最后一次通信的时间
        timeStamp = Date().timeIntervalSince1970
    }
    
}
